package gcj2012.round1a;


import java.util.Arrays;
import java.util.Comparator;

import common.AbstractRunner;
import common.AbstractRunner.SIZE;

public class A extends AbstractRunner {
	
	
	@Override
	public void handleCase(int caseNumber) throws Exception {		
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		double[] p = new double[a];		
		
		for (int i=0; i<a; i++) {
			p[i] = scanner.nextDouble();			
		}
		
		double min = b+2;
		
		double product = 1;
		for (int k=a-1; k>=0; k--) {
			product *= p[a-k-1];
			double cand = (b-a+1) + 2*k + (1-product) * (b+1);
			if (cand < min) min = cand;
		}
		out.write(""+min);
		out.write("\n");
		
	}
	
	public static void main(String[] args) throws Exception {
		new A().init(SIZE.large).execute();
	}
}

